package lg.minecraft.plugin.testeconomy.config;

import lg.minecraft.plugin.testeconomy.TestEconomy;
import lombok.Getter;

/**
 * @author langle__
 * @version 1.0
 */
public class MessageConfig {

    // 子命令帮助信息
    @Getter private static final String BALANCE_USAGE = "§6[测试经济]§f te balance [玩家]";
    @Getter private static final String GIVE_USAGE = "§6[测试经济]§f te give [玩家] <金额>";
    @Getter private static final String TAKE_USAGE = "§6[测试经济]§f te take [玩家] <金额>";
    @Getter private static final String SET_USAGE = "§6[测试经济]§f te set [玩家] <金额>";
    @Getter private static final String RELOAD_USAGE = "§6[测试经济]§f te reload";

    // 错误信息
    @Getter private static final String PLAYER_NOT_FOUND = "§c[测试经济]§f 玩家不存在";
    @Getter private static final String INVALID_AMOUNT = "§c[测试经济]§f 金额是无效数值";
    @Getter private static final String UNKNOWN_COMMAND = "§c[测试经济]§f 未知的子命令";

    // 成功信息
    @Getter private static final String BALANCE_SUCCESS = "§6[测试经济]§f 你的余额为: §a{amount}§f金币";
    @Getter private static final String BALANCE_OTHER_SUCCESS = "§6[测试经济]§f §d{player} 的余额为: §a{amount}§f金币";
    @Getter private static final String GIVE_SUCCESS = "§6[测试经济]§f 成功§e给予 §d{player} §a{amount}§f金币";
    @Getter private static final String TAKE_SUCCESS = "§6[测试经济]§f 成功§e扣除 §d{player} §a{amount}§f金币";
    @Getter private static final String SET_SUCCESS = "§6[测试经济]§f 成功§e设置 §d{player} §a{amount}§f金币";
    @Getter private static final String RELOAD_SUCCESS = "§6[测试经济]§f 配置已重新加载";

    @Getter private static final String[] PLUGIN_INFO_ARRAY = {
            "§6§lTest§eEconomy §7[§f" + TestEconomy.getInstance().getDescription().getVersion() + "§7]",
            "§7作者:§f langle__",
            "§7帮助:§f /te help",
            "§7存储:§f " + TestEconomy.getStorage().getType().name
    };

    @Getter private static final String[] HELP_ARRAY = {
            "§6[测试经济]§f /te help",
            "§6[测试经济]§f /te balance <player>",
            "§6[测试经济]§f /te give <player> <amount>",
            "§6[测试经济]§f /te take <player> <amount>",
            "§6[测试经济]§f /te set <player> <amount>",
            "§6[测试经济]§f /te reload"
    };

    public static String getBalanceSuccess(double amount) {
        return BALANCE_SUCCESS.replace("{amount}", String.valueOf(amount));
    }

    public static String getBalanceOtherSuccess(String playerName, double amount) {
        return BALANCE_OTHER_SUCCESS.replace("{player}", playerName).replace("{amount}", String.valueOf(amount));
    }

    public static String getGiveSuccess(String playerName, double amount) {
        return GIVE_SUCCESS.replace("{player}", playerName).replace("{amount}", String.valueOf(amount));
    }

    public static String getTakeSuccess(String playerName, double amount) {
        return TAKE_SUCCESS.replace("{player}", playerName).replace("{amount}", String.valueOf(amount));
    }

    public static String getSetSuccess(String playerName, double amount) {
        return SET_SUCCESS.replace("{player}", playerName).replace("{amount}", String.valueOf(amount));
    }

}
